
export const LOGIN = 'login';

export const LOGOUT = 'logout';

export const TITLE = 'title';

export const timeStamp = (bool,time) => { //时间戳  bool (精确度)  时间字段数组
	var obj = time;
    var newDate = new Date();
    newDate.setTime(obj * 1000);

    var year = newDate.getFullYear();
    var month = newDate.getMonth() + 1;
    month = month < 10 ? "0" + month : month;
    var date = newDate.getDate();
    date = date < 10 ? "0" + date : date;

    var hours = newDate.getHours();
    hours = hours < 10 ? "0" + hours : hours;
    var minute = newDate.getMinutes();
    minute = minute < 10 ? "0" + minute : minute;
    var second = newDate.getSeconds();
    second = second < 10 ? "0" + second : second;

    if (bool) {
      return year + "-" + month + "-" + date + " " + hours + ":" + minute + ":" + second;
    } else {
      return year + "-" + month + "-" + date;
    }
};
